/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import BLL.BProduct;
import BLL.BUser;

/**
 *
 * @author Vien-IT
 */
public class Comment {
    private int commnetId;
    private String comment;
    private int userId;
    private int productId;
    private User user;
    private Product product;

    /**
     * @return the commnetId
     */
    public int getCommnetId() {
        return commnetId;
    }

    /**
     * @param commnetId the commnetId to set
     */
    public void setCommnetId(int commnetId) {
        this.commnetId = commnetId;
    }

    /**
     * @return the comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * @param comment the comment to set
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     * @return the userId
     */
    public int getUserId() {
        return userId;
    }

    /**
     * @param userId the userId to set
     */
    public void setUserId(int userId) {
        this.userId = userId;
    }

    /**
     * @return the productId
     */
    public int getProductId() {
        return productId;
    }

    /**
     * @param productId the productId to set
     */
    public void setProductId(int productId) {
        this.productId = productId;
    }

    /**
     * @return the user
     */
    public User getUser() {
        
        if(user == null)
        {
            user = new BUser().getById(this.userId);
        }
        return user;
    }

   
   

    /**
     * @return the product
     */
    public Product getProduct() {
        if(product == null)
        {
            product = new BProduct().getById(productId);
        }
        return product;
    }

   
    
}
